package com.rd.student.jiaji.class4.suyan.zrrd.day13;

import java.util.Random;
import java.util.Scanner;

public class Scannertest {
    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
       System.out.println("next数据为：");
        //接收
        if (scanner.hasNext()){
            String str =scanner.next();
            System.out.println(str);
        }
        System.out.println("nextLine数据为：");
        if (scanner.hasNextLine()){
            String str1=scanner.nextLine();
            System.out.println(str1);
        }


        System.out.println(Math.random());
        //随机生成【0.0，1.0】范围内的伪随机数
        int min = 2;
        int max = 100;
        for (int i=0;i<100;i++){
            int random = min + (int) (Math.random() * (max - min));
            System.out.println(random);
        }


        System.out.println(Math.sqrt(16));
        double d = 11.23;
// 向上取整 向下取整  四舍五入
        System.out.println(Math.floor(d));//向下取整
        System.out.println(Math.ceil(d));
        System.out.println(Math.round(d));
        System.out.println(Math.round(11.99));
        System.out.println(Math.PI);

    }
}















